project(SER_DES_TEST_FAST_INTRINSICS)

set(ARKTSCONFIG_VER_2_PATH "${CMAKE_CURRENT_BINARY_DIR}/arktsconfig_ver_2.json")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/arktsconfig_ver_2.json.in" "${ARKTSCONFIG_VER_2_PATH}")

compile_panda_source_list(
    TARGET_NAME ser_des_test_ver_2_srcs
    SOURCE_LIST
        "${SER_DES_TEST_SOURCE_DIR}/SerDesTest.ets"
    ARKTSCONFIG ${ARKTSCONFIG_VER_2_PATH}
)

run_user_app(
    TARGET_NAME ser_des_test_ver_2_run
    EXTRA_DEPS
        ser_des_test_ver_2_srcs
        ser_des_user_ver_2_merged_srcs
        measure_native_lib_srcs
    CLASSNAME SerDesTest.SerDesTest
    USER_ABC_PATH ${CMAKE_CURRENT_BINARY_DIR}/SerDesTest.abc
    EXTRA_BOOT_FILES
        ${SER_DES_USER_VER_2_MERGED_BINARY_DIR}/SerDesUserVer2.abc
        ${MEASURE_NATIVE_LIB_BINARY_DIR}/MeasureNativeLib.abc
    ARK_AOT
    EXTRA_LAUNCHER_OPTS
        "--PandaOpt=--ext:--compiler-enable-jit=false"
        "--PandaOpt=--ext:--native-library-path=${SER_DES_USER_VER_2_MERGED_BINARY_DIR}:${MEASURE_NATIVE_LIB_BINARY_DIR}"
)
